package com.auto.practice;

import com.auto.Utils.MybatisUtils;
import com.auto.dao.EnviromentMapper;
import com.auto.dao.RolesMapper;
import com.auto.dao.SpringTest;
import com.auto.dao.St;
import com.auto.pojo.Enviroment;
import com.auto.pojo.Roles;
import org.apache.ibatis.session.SqlSession;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class Practice {
public static  void main(String[] args){

    SqlSession sqlsession = MybatisUtils.getSqlSession();
//    RolesMapper rolesMapper = sqlsession.getMapper(RolesMapper.class);
//    List<Roles> rolesList = rolesMapper.seletRoles();
//    for(Roles roles:rolesList){
//        System.out.println(roles);
//    }
    System.out.println("ddddddd");
    EnviromentMapper enviromentMapper = sqlsession.getMapper(EnviromentMapper.class);
    List<Enviroment> enviromentList = enviromentMapper.selectEnviroment();
    for(Enviroment enviroment:enviromentList){
        System.out.println(enviroment);
    }
    sqlsession.close();
//    System.out.println("ddddddd");
//    ApplicationContext application = new ClassPathXmlApplicationContext("applicationContext.xml");
//    Enviroment sp = (Enviroment) application.getBean("en");
//    System.out.println("ddddddd");
//    System.out.println(sp.getEnviromentDescripte());
//    System.out.println(sp.toString());


}


}
